package com.fzkj.juc.readwritelock;

/**
 * @DESCRIPTION 读写锁demo
 */
public class ReadWriteLockDemo {

    public static void main(String[] args) {
        SimpleCache cache = new SimpleCache();

        for (int i = 0; i < 5; i++) {
            final int tem = i;
            new Thread(() -> {
                cache.put(tem + "", tem + "");
                Object o = cache.get(tem + "");
            }, String.valueOf(i)).start();
        }

        for (int i = 0; i < 5; i++) {
            final int tem = i;
            new Thread(() -> {
                Object o = cache.get(tem + "");
            }, String.valueOf(i)).start();
        }
    }

}
